<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加创业股东</title>
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		
	</head>

	<body>
		 <form class="mui-input-group gerenzl_group layui-form">
		<br />
			<div class="layui-form-item">
				<label style="width: 130px;" class="layui-form-label">创业股东会员编号</label>
				<div class="layui-input-block update_shurk">
					<input type="text" style="width: 230px;" id="mobile" name="mobile" lay-verify="required"  autocomplete="off" class="layui-input">
				</div>
			</div>
		
			<div class="layui-form-item update_btnbox">
				<div class="layui-input-block">
					<button class="layui-btn" type="button"  lay-submit lay-filter="submit_from" >立即提交</button>
				</div>
			</div>
		</form>
	</body>
</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>

<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	//图片上传
	layui.use(['form'], function(){
  		var $ = layui.jquery,form = layui.form;
  		//监听表单提交
		form.on('submit(submit_from)', function(data){
			tijiao();
  			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});
 	});
	//提交表单
	function tijiao(){
		var phone = $("#mobile").val();
		if(phone == '') {
			layer.msg('手机号码不能为空');
			return;
		}
		var reg = /^1[3|4|5|7|8][0-9]{9}$/; //验证规则
		if(!reg.test(phone)) {
			layer.msg('手机号码格式不正确');
			onoff = true;
			return;
		}
  		 $.ajax({
             	type:"post",
                url:"{:url('pt_add')}",
                data: $('.layui-form').serialize(),//表单数据
                success:function(data){
                	var icon=5;
                	if(data.code==200){
                		icon=1;
                	}
                    layer.msg(data.msg, {
						  icon: icon,
						  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
				       	parent.layer.close(index); 
						window.parent.location.reload();
					});
                },error:function(data){
                	var a = data;
                }
        });
  		
  	}
</script>